import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

//懒加载
const Mine = (resolve) => {
  import('@/components/Mine/mine').then((module) => {
    resolve(module)
  })
};
//认证
const Authentication = (resolve) => {
  import('@/components/Authentication/authentication').then((module) => {
    resolve(module)
  })
};
//医生信息doctorinformation
const Doctorinformation = (resolve) => {
  import('@/components/Authentication/doctorinformation').then((module) => {
    resolve(module)
  })
};
//认证资料authenticationdata
const Authenticationdata = (resolve) => {
  import('@/components/Authentication/authenticationdata').then((module) => {
    resolve(module)
  })
};
//擅长speciality
const Speciality = (resolve) => {
  import('@/components/Authentication/speciality').then((module) => {
    resolve(module)
  })
};
//电子病历
const MedicalRecord= (resolve) =>{
  import('@/components/Authentication/medicalRecord').then((module)=>{
    resolve(module)
  })
};
//电子病历详情recorddetial
const RecordDetial = (resolve) => {
  import('@/components/Authentication/recorddetial').then((module)=>{
    resolve(module)
  })
};
//auditstatus
const Auditstatus = (resolve) => {
  import('@/components/Authentication/auditstatus').then((module)=>{
    resolve(module)
  })
};
//新增病历(基础信息)
const AddBaseInfo=(resolve)=>{
  import('@/components/medicalRecord/addbaseInfo').then((module)=>{
    resolve(module)
  })
};
const AddPictureReprot=(resolve)=>{
  import('@/components/medicalRecord/addPictureReprot').then((module)=>{
    resolve(module)
  })
};
//文章
const Articlelist=(resolve)=>{
  import('@/components/Article/list').then((module)=>{
    resolve(module)
  })
};
const Articledetial=(resolve)=>{
  import('@/components/Article/detial').then((module)=>{
    resolve(module)
  })
};
const Wodeshoucang=(resolve)=>{
  import('@/components/Article/wodeshoucang').then((module)=>{
    resolve(module)
  })
};
const Patientlist=(resolve)=>{
  import('@/components/Patient/patientlist').then((module)=>{
    resolve(module)
  })
};
const Doctorlist=(resolve)=>{
  import('@/components/Patient/doctorlist').then((module)=>{
    resolve(module)
  })
};

export default new Router({
  routes: [
    {
      path: '/',
      component: Mine,
      redirect:'/mine',
      meta: {
        title: '个人中心',
        index:1
      }
    },
    {
      path:'/mine',
      name:'mine',
      component:Mine,
      meta: {
        title: '个人中心',
        index:1
      }
    },
    {
      path:'/authentication',
      name:'认证中心',
      component:Authentication,
      meta: {
        title: '认证中心',
      }
    },
    {
      path:'/doctorinformation',
      name:'实名认证',
      component:Doctorinformation,
      meta: {
        title: '实名认证',
        index:3
      }
    },
    {
      path:'/authenticationdata',
      name:'实名认证',
      component:Authenticationdata,
      meta: {
        title: '实名认证',
        index:5
      }
    },
    {
      path:'/speciality',
      name:'擅长',
      component:Speciality,
      meta: {
        title: '擅长',
        index:4
      }
    },
    {
      path:'/medicalRecord',
      name:'电子病历',
      component:MedicalRecord,
      meta:{
        title:'电子病历',
        index:3
      }
    },
    {
      path:'/recorddetial',
      name:'病历详情',
      component:RecordDetial,
      meta:{
        title:'病历详情',
        index:4
      }
    },
    {
      path:'/auditstatus',
      name:'审核状态',
      component:Auditstatus,
      meta:{
        title:'审核状态',
        index:2
      }
    },
    {
      path:'/addBaseInfo',
      name:'新增病历(基础)',
      component:AddBaseInfo,
      meta:{
        title:'新增病历',
        index:5
      }
    },
    {
      path:'/addPictureReprot',
      name:'新增病历(图片)',
      component:AddPictureReprot,
      meta:{
        title:'新增报告',
        index:5
      }
    },
    {
      path:'/articlelist',
      name:'文章列表',
      component:Articlelist,
      meta:{
        title:'文章列表',
        index:2
      }
    },
    {
      path:'/articledetial',
      name:'文章详情',
      component:Articledetial,
      meta:{
        title:'文章详情',
        index:3
      }
    },
    {
      path:'/wodeshoucang',
      name:'我的收藏',
      component:Wodeshoucang,
      meta:{
        title:'我的收藏',
        index:2
      }
    },
    {
      path:'/patientlist',
      name:'患者列表',
      component:Patientlist,
      meta:{
        title:'患者列表',
        index:2
      }
    },
    {
      path:'/doctorlist',
      name:'医生列表',
      component:Doctorlist,
      meta:{
        title:'医生列表',
        index:2
      }
    },
  ]
})
